set only allow post request to a page - php

123

//only allow post request
if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) {
	header('Allow: POST');
	header('HTTP/1.1 405 Method Not Allowed');
	header('Content-Type: text/plain');
	echo "only allow post";
	exit;
}

Comments

Submit
0 Comments